package feipeng.yacamcorder;


import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuInflater;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebChromeClient;
//import android.widget.SearchView;
import android.widget.TextView;

public class BrowserView extends Activity {

	TextView mSearchText;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.browser_view);
        
        WebView wv = (WebView) findViewById(R.id.webview);
        wv.setWebViewClient(new WebViewClient());
        WebSettings webSettings = wv.getSettings();
        //webSettings.setUserAgentString("foo");
        webSettings.setJavaScriptEnabled(true);
        webSettings.setAppCacheEnabled(false);
        webSettings.setBuiltInZoomControls(true);
        wv.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
            	BrowserView.this.setProgress(progress * 100);
            }
        });
        wv.loadUrl("http://www.google.com/");
        TextView mSearchText = new TextView(this);
        setContentView(mSearchText);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        //getMenuInflater().inflate(R.menu.browser_view, menu);
        //return true;
        MenuInflater inflater = getMenuInflater();
        //inflater.inflate(R.menu.actions, menu);
       // SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
       // searchView.setOnQueryTextListener(this);
        return true;
    }
}
